<?php
use think\facade\Route;

// 课程分类
Route::group('admin/category', function () {
    Route::get('/list$',            'getList'); // 课程分类列表
    Route::get('/<id>/children$',   'getChildren')->pattern(['id' => '\d+']); // 课程分类列表
    Route::post('/create$',         'createCategory'); // 添加课程分类
    Route::put('/<id>$',            'editCategory')->pattern(['id' => '\d+']); // 编辑课程分类
    Route::delete('/<id>$',         'deleteCategory')->pattern(['id' => '\d+']); // 删除课程分类

})->prefix('\app\common\service\category\admin\Category@')->append(['category_type' => 2])->middleware(['adminRoute']);